﻿@using DevExtreme.NETCore.Demos.Models.DataGrid

@model IEnumerable<Employee>

@(Html.DevExtreme().DataGrid<Employee>()
    .ID("gridContainer")
    .ShowBorders(true)
    .DataSource(Model, new[] { "ID" })
    .Columns(columns => {
        columns.AddFor(m => m.Picture)
            .Width(100)
            .AllowFiltering(false)
            .AllowSorting(false)
            .CellTemplate(@<text>
                <div>
                    <img src="<%- value %>" alt=""/>
                </div>
            </text>);

        columns.AddFor(m => m.Prefix)
            .Width(70);

        columns.AddFor(m => m.FirstName);

        columns.AddFor(m => m.LastName);

        columns.AddFor(m => m.Position);

        columns.AddFor(m => m.BirthDate);

        columns.AddFor(m => m.HireDate);
    })
)
